package com.yanxu.design01_singleton.hungry;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2025/4/10-2025
 * @Description: 饿汉式-单例
 */
public class HungrySingleton1 {
    //声明并创建
    private static HungrySingleton1 instance = new HungrySingleton1();

    //构造方法私有化
    private HungrySingleton1() {
        System.out.println("创建 HungrySingleton1 对象!!!");
    }

    public static HungrySingleton1 getInstance() {
        return instance;
    }
}